<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserLoginLog extends Model
{
    protected $table = 'user_login_log';

    protected $fillable = [
        'name',
        'gid',
        'zjhm',
        'type',
        'ip',
        'description',
        'relation_id',
        'relation_table',
        'input',
        'method',
    ];

    //来源
    const PC = 1;
    const Wechat = 2;
    const PHONE = 3;
    public static $sourceMap = [
        self::PC => 'PC',
        self::Wechat => '微信',
        self::PHONE => '手机',
    ];

    //日志类型
    const TYPE1 = 1;
    const TYPE2 = 2;
    const TYPE_OTHER = 3;
    const TYPE_REGISTER = 4;
    public static $typeMap = [
        self::TYPE1 => '登录',
        self::TYPE2 => '退出',
        self::TYPE_OTHER => '其它',
        self::TYPE_REGISTER => '注册'
    ];

}
